<template>
	<view>
		<view class="index">
			<view :class="'header ' + (banertrue ? 'header_lan' : '')" :style="'padding-top: ' + navH + 'px;'">
				<view class="header_height" :style="'height:' + gaodu + 'px;line-height:' + gaodu + 'px;top:' + gaodutops + 'px;'">
					<view class="index_h_cont3">
						<!-- （Change Language） -->
						<view @click="changelang" class="languagechange" style="font-size: 24rpx;margin-left:30rpx;font-weight: bold;color:#fff;">{{ $t('pageindex.语言切换')}}（Change Language）</view>
					</view>
				</view>
				<view class="coloe_title"></view>
			</view>
			<view class="index_banner" style="position: relative; background: #fff">
				<image :src="imgUrl + '/dzx_img93.png'" mode="widthFix"></image>
				<view class="my_top_cont">
					<view  class="my_top" :style="switchFunlist.is_fyaoqing == 0 ? 'padding-bottom:10px' : ''" >
						<!-- 微信授权手机号一键登录 -->
						<!-- #ifdef H5|| APP-PLUS -->
						<view class="my_top_item1" v-if="islogin">
							<view class="my_top_item1_l">
								<!-- <button class="chooseAvatar" open-type="chooseAvatar" @chooseavatar="onChooseAvatar"></button> -->
								<image @tap="tiaozhuanus" data-url="/pages/mys/my_userinfo/my_userinfo" class="avatarUrl" :src="userarr.avatarUrl ? userarr.avatarUrl : imgUrl + '/dzx_img94.png'" mode="aspectFill"></image>
								<view class="my_top_item1_l_txt">
									<view class="my_top_item1_t1">
										<input @input="changenickname" @blur="changenickname" class="my_top_item1_t1" type="nickname" :value="userarr.nickName" />
									</view>
									<view class="my_top_item1_t1" style="margin-top: 10rpx">
										<text class="grade" v-if="userarr.grade">{{ userarr.grade.name }}</text>
										<text v-if="yonghujuese.role_type != 0">{{ yonghujuese.role_name }}</text>
										<text class="sharp" v-if="is_sharp == 1">{{ $t('page_my.head') }}</text>
									</view>
									<view class="my_top_item1_t2" v-if="switchFunlist && switchFunlist.usercode_mode.is_show != 0">Code：{{ userarr.user_code }}</view>
									<view class="my_top_item1_t2" v-if="switchFunlist && switchFunlist.usercode_mode.is_show != 1">ID：{{ userarr.user_id }}</view>
								</view>
							</view>
							<view
								v-if="switchFunlist.is_balance == 1"
								class="my_top_item1_r"
								@tap="tiaozhuanus"
								:data-url="'/pages/mys/my_chongzhi/my_chongzhi?yue=' + userarr.balance"
							>
								{{ $t('page_my.balance_recharge') }}
							</view>
						</view>
						<view v-if="!islogin"  class="my_top_item1" >
							<view class="my_top_item1_l" @click.stop="getUserProfile">
								<image :src="imgUrl + '/dzx_img94.png'" mode="aspectFill"></image>
								<view class="my_top_item1_l_txte">
									<view class="my_top_item1_t1">{{ $t('page_my.not_logged_in') }}</view>
								</view>
							</view>
							<view class="my_top_item1_r" @click.stop="getUserProfile" data-url="/pages/mys/my_chongzhi/my_chongzhi">{{ $t('page_my.please_log_in_first') }}</view>
						</view>
						<!-- #endif -->
						
						<!-- #ifdef MP-WEIXIN -->
						<view class="my_top_item1" v-if="islogin">
							<view class="my_top_item1_l">
								<!-- <button class="chooseAvatar" open-type="chooseAvatar" @chooseavatar="onChooseAvatar"></button> -->
								<image @tap="tiaozhuanus" data-url="/pages/mys/my_userinfo/my_userinfo" class="avatarUrl" :src="userarr.avatarUrl ? userarr.avatarUrl : imgUrl + '/dzx_img94.png'" mode="aspectFill"></image>
								<view class="my_top_item1_l_txt" >
									<view class="my_top_item1_t1">
										<text class="usercode" @tap="tiaozhuanus" data-url="/pages/mys/my_userinfo/my_userinfo" v-if="switchFunlist.usercode_mode.is_show == 1">CODE：{{userarr.user_code}}</text>
										<text class="usercode" @tap="tiaozhuanus" data-url="/pages/mys/my_userinfo/my_userinfo" v-if="switchFunlist.usercode_mode.is_show == 0">ID：{{userarr.user_id}}</text>
										<text @click="changemarkshow()" class="usercode" v-if="switchFunlist.usercode_mode.is_show == 2 && usermark">唛头：{{ usermark.mark }}</text>
										<text @click="addmarkshows()" class="usercode" v-if="switchFunlist.usercode_mode.is_show == 2 && !usermark">请添加唛头</text>
										<text class="usercode">{{$t('page_other.昵称')}}：{{userarr.nickName}}</text>
									</view>
									<view class="my_top_item1_t1" style="margin-top: 10rpx">
										<text @tap="tiaozhuanus" data-url="/pages/mys/userVip/userVip" class="grade" v-if="userarr.grade.name">{{ userarr.grade.name }}</text>
										<text v-if="yonghujuese.role_type != 0">{{ yonghujuese.role_name }}</text>
										<text class="sharp" v-if="is_sharp == 1">{{ $t('page_my.head') }}</text>
									</view>
									<view class="my_top_item1_t2" v-if="userarr.service">{{$t('page_other.专属客服')}}：{{userarr.service.real_name}}</view>
								</view>
							</view>
							<view
								v-if="switchFunlist.is_balance == 1"
								class="my_top_item1_r"
								@tap="tiaozhuanus"
								:data-url="'/pages/mys/my_chongzhi/my_chongzhi?yue=' + userarr.balance"
							>
								{{ $t('page_my.balance_recharge') }}
							</view>
						</view>
						<view class="my_top_item1" v-else-if="islogin==false">
							<view class="my_top_item1_l" @tap="loginChange">
								<image :src="imgUrl + '/dzx_img94.png'" mode="aspectFill"></image>
								<view class="my_top_item1_l_txte">
									<view class="my_top_item1_t1">{{ $t('page_my.not_logged_in') }}</view>
								</view>
							</view>
							<view class="my_top_item1_r" @tap="loginChange" data-url="/pages/mys/my_chongzhi/my_chongzhi">
								{{ $t('page_my.please_log_in_first') }}
							</view>
						</view>
						<!-- #endif -->

						<view class="my_top_item2">
							<view class="my_top_item2_list">
								<view v-if="switchFunlist.is_balance == 1" class="my_top_item2_cont" @tap="tiaozhuanus" data-url="/pages/mys/my_yue/my_yue">
									<view class="my_top_item2_t1">{{ userarr.balance ? userarr.balance : 0 }}</view>
									<view class="my_top_item2_t2">{{ $t('page_my.my_balance') }}</view>
								</view>
								<view v-if="switchFunlist.is_sitesms == 1" class="my_top_item2_cont" @tap="tiaozhuanus" data-url="/pages/mys/my_sms/my_sms">
									<view class="my_top_item2_t1">{{ userarr.sms ? userarr.sms : 0 }}</view>
									<view class="my_top_item2_t2">{{ $t('page_my.station_message') }}</view>
								</view>
								<view v-if="switchFunlist.is_cuppon == 1" class="my_top_item2_cont" @tap="tiaozhuanus" data-url="/pages/mys/my_yhq/my_yhq">
									<view class="my_top_item2_t1">{{ userarr.coupon ? userarr.coupon : 0 }}</view>
									<view class="my_top_item2_t2">{{ $t('page_my.coupon') }}</view>
								</view>
								<view v-if="pointsetting && pointsetting.is_open == 1" class="my_top_item2_cont" @tap="tiaozhuanus" data-url="/pages/mys/my_jifen/my_jifen">
									<view class="my_top_item2_t1">{{ userarr.points ? userarr.points : 0 }}</view>
									<view class="my_top_item2_t2">{{ $t('page_my.integral') }}</view>
								</view>
							</view>
						</view>
						<view
							v-if="switchFunlist.is_fyaoqing == 1"
							class="my_top_item3"
							@tap="tiaozhuanus"
							:data-url="is_dealer == true ? '/pages/mys/my_fenxiaoewm/my_fenxiaoewm' : pageFen"
						>
							<image :src="imgUrl + '/dzx_img95.png'"></image>
							<view class="my_top_item3_btn">
								<text>{{ $t('page_my.invite_now') }}</text>
								<image :src="imgUrl + '/dzx_img96.png'"></image>
							</view>
						</view>
					</view>
				</view>
			</view>
			<!-- #ifdef MP-WEIXIN -->
			<view v-if="switchFunlist.is_wechatgzh == 1" class="item-official"><official-account></official-account></view>
			<!-- #endif -->
			<!-- 微信公众号关注 -->
			<view class="index_item6 borderstyle" v-if="officialaccount && officialaccount.is_my_open==1">
				<view class="index_item6_dis_off">
					<view class="index_item5_cont_top_l">
						<image :src="officialaccount.official_image" mode="aspectFill"></image>
						<view class="index_item5_cont_top_txt">
							<view class="index_item5_cont_top_t1">{{ officialaccount.name }}</view>
							<view class="index_item5_cont_top_t2">{{ officialaccount.description }}</view>
						</view>
					</view>
					<view class="index_item6_rr" @tap="tiaozhuanofficialaccount" :data-type="officialaccount.type" :data-url="officialaccount.link">
						<text>{{ $t('page_index.guanzhu') }}</text>
					</view>
				</view>
			</view>
			
			<view class="index_center">
				<view class="my_center">
					<view class="my_bottom">
						<view v-if="switchFunlist.is_jiyun == 1" class="my_bottom_item1">
							<view class="my_bottom_item1_title">
								<view class="my_bottom_item1_t1">{{ $t('page_my.my_order') }}</view>
								<view class="my_bottom_item1_t2" @tap="jiyundingdan" data-url="/pages/indexs/my_dingdan/my_dingdan?id=0&type=0">
									<text>{{ $t('page_my.view_all_orders') }}</text>
									<image :src="imgUrl + '/dzx_img102.png'"></image>
								</view>
							</view>
							<view class="my_bottom_item1_list">
								<view class="my_bottom_item1_cont text-center" @tap="jiyundingdan" data-url="/pages/indexs/my_dingdan/my_dingdan?id=1&type=verify">
									<image :src="imgUrl + '/dzx_img97.png'"></image>
									<text>{{ $t('page_my.to_be_checked') }}</text>
									<view class="my_bottom_item1_shuliang" v-if="tongjishu.verify != 0">{{ tongjishu.verify }}</view>
								</view>
								<view class="my_bottom_item1_cont text-center" @tap="jiyundingdan" data-url="/pages/indexs/my_dingdan/my_dingdan?id=2&type=nopay">
									<image :src="imgUrl + '/dzx_img98.png'"></image>
									<text>{{ $t('page_my.pending_payment') }}</text>
									<view class="my_bottom_item1_shuliang" v-if="tongjishu.no_pay != 0">{{ tongjishu.no_pay }}</view>
								</view>
								<view class="my_bottom_item1_cont text-center" @tap="jiyundingdan" data-url="/pages/indexs/my_dingdan/my_dingdan?id=3&type=no_send">
									<image :src="imgUrl + '/dzx_img99.png'"></image>
									<text>{{ $t('page_my.to_be_delivered') }}</text>
									<view class="my_bottom_item1_shuliang" v-if="tongjishu.no_send != 0">{{ tongjishu.no_send }}</view>
								</view>
								<view class="my_bottom_item1_cont text-center" @tap="jiyundingdan" data-url="/pages/indexs/my_dingdan/my_dingdan?id=4&type=send">
									<image :src="imgUrl + '/dzx_img100.png'"></image>
									<text>{{ $t('page_my.shipped') }}</text>
									<view class="my_bottom_item1_shuliang" v-if="tongjishu.send != 0">{{ tongjishu.send }}</view>
								</view>
								<view class="my_bottom_item1_cont text-center" @tap="jiyundingdan" data-url="/pages/indexs/my_dingdan/my_dingdan?id=5&type=complete">
									<image :src="imgUrl + '/dzx_img101.png'"></image>
									<text>{{ $t('page_my.completed') }}</text>
									<view class="my_bottom_item1_shuliang" v-if="tongjishu.complete != 0">{{ tongjishu.complete }}</view>
								</view>
							</view>
						</view>
						<view v-if="switchFunlist.is_pintuan == 1" class="my_bottom_item1">
							<view class="my_bottom_item1_title">
								<view class="my_bottom_item1_t1">{{ $t('page_my.group_order') }}</view>
								<view class="my_bottom_item1_t2" @tap="pintuandingdan" data-url="/pages/sharing/sharing_order_center" data-item="1">
									<text>{{ $t('page_my.puzzle_Plaza') }}</text>
									<image :src="imgUrl + '/dzx_img102.png'"></image>
								</view>
							</view>
							<view class="my_bottom_item1_list">
								<view class="my_bottom_item1_cont text-center" @tap="pintuandingdan" data-url="/pages/sharing/sharing_order?id=1&type=sharing" data-item="1">
									<image :src="imgUrl + '/dzx_img103.png'"></image>
									<text>{{ $t('page_my.in_the_group') }}</text>
								</view>
								<view class="my_bottom_item1_cont text-center" @tap="pintuandingdan" data-url="/pages/sharing/sharing_order?id=2&type=no_pay" data-item="1">
									<image :src="imgUrl + '/dzx_img105.png'"></image>
									<text>{{ $t('page_my.pending_payment') }}</text>
								</view>
								<view class="my_bottom_item1_cont text-center" @tap="pintuandingdan" data-url="/pages/sharing/sharing_order?id=3&type=no_send" data-item="1">
									<image :src="imgUrl + '/dzx_img106.png'"></image>
									<text>{{ $t('page_my.to_be_delivered') }}</text>
								</view>
								<view class="my_bottom_item1_cont text-center" @tap="pintuandingdan" data-url="/pages/sharing/sharing_order?id=4&type=received" data-item="1">
									<image :src="imgUrl + '/dzx_img107.png'"></image>
									<text>{{ $t('page_my.to_be_received') }}</text>
								</view>
								<view class="my_bottom_item1_cont text-center" @tap="pintuandingdan" data-url="/pages/sharing/sharing_order?id=5&type=complete" data-item="1">
									<image :src="imgUrl + '/dzx_img104.png'"></image>
									<text>{{ $t('page_my.completed') }}</text>
								</view>
								<!-- 	<view class="my_bottom_item1_cont" @tap="onTargetRefund" data-item="1">
									<image :src="imgUrl+'/dzx_img104.png'"></image>
									<text>售后</text>
								</view> -->
							</view>
						</view>
						<view class="my_bottom_item1" v-if="switchFunlist.is_shoporder == 1" >
							<view class="my_bottom_item1_title">
								<view class="my_bottom_item1_t1">{{$t('page_my.shoporder')}}</view>
							</view>
							<view class="my_bottom_item1_list" style="padding: 0;">
								<view class="my_bottom_item1_cont" @tap="goyemian"
									data-url="/pages/order/index?type=all">
									<image :src="imgUrl + '/dzx_img109.png'"></image>
									<text>{{$t('page_my.quanbu')}}</text>
								</view>
								<view class="my_bottom_item1_cont" @tap="goyemian"
									data-url="/pages/order/index?type=payment">
									<image :src="imgUrl + '/dzx_img105.png'"></image>
									<text>{{$t('page_my.daifukuan')}}</text>
								</view>
								<view class="my_bottom_item1_cont" @tap="goyemian"
									data-url="/pages/order/index?type=delivery">
									<image :src="imgUrl + '/dzx_img106.png'"></image>
									<text>{{$t('page_my.daifahuo')}}</text>
								</view>
								<view class="my_bottom_item1_cont" @tap="goyemian"
									data-url="/pages/order/index?type=received">
									<image :src="imgUrl + '/dzx_img107.png'"></image>
									<text>{{$t('page_my.zaituzhong')}}</text>
								</view>
								<view class="my_bottom_item1_cont" @tap="goyemian"
									data-url="/pages/order/index?type=comment">
									<image :src="imgUrl + '/dzx_img104.png'"></image>
									<text>{{$t('page_my.yiwancheng')}}</text>
								</view>
							</view>
						</view>
						<view v-if="switchFunlist.is_fenxiao == 1 && islogin" class="my_bottom_item1">
							<view class="my_bottom_item1_title">
								<view class="my_bottom_item1_t1">{{ words.index.title.value }}</view>
							</view>
							<view class="my_bottom_item1_list" style="padding: 0">
								<view v-if="is_dealer" class="my_bottom_item1_cont" @tap="goyemian" :data-url="is_dealer == true ? '/pages/mys/my_fenxiao/my_fenxiao' : pageFen">
									<image :src="imgUrl + '/dzx_img108.png'"></image>
									<text>{{ words.index.title.value }}</text>
								</view>
								<view
									v-if="!is_dealer"
									class="my_bottom_item1_cont"
									@tap="goyemian"
									:data-url="is_dealer == true ? '/pages/mys/my_dealer/dealer_index/dealer_index' : pageFen"
								>
									<image :src="imgUrl + '/dzx_img108.png'"></image>
									<text>{{ words.apply.title.value }}</text>
								</view>
								<view class="my_bottom_item1_cont" @tap="goyemian" :data-url="is_dealer == true ? '/pages/mys/my_fanyongdingdan/my_fanyongdingdan' : pageFen">
									<image :src="imgUrl + '/dzx_img109.png'"></image>
									<text>{{ words.order.title.value }}</text>
								</view>
								<view class="my_bottom_item1_cont" @tap="goyemian" :data-url="is_dealer == true ? '/pages/mys/my_tixianmx/my_tixianmx' : pageFen">
									<image :src="imgUrl + '/dzx_img110.png'"></image>
									<text>{{ words.withdraw_list.title.value }}</text>
								</view>
								<view class="my_bottom_item1_cont" @tap="goyemian" :data-url="is_dealer == true ? '/pages/mys/my_tuandui/my_tuandui' : pageFen">
									<image :src="imgUrl + '/dzx_img111.png'"></image>
									<text>{{ words.team.title.value }}</text>
								</view>
								<view class="my_bottom_item1_cont" @tap="goyemian" :data-url="is_dealer == true ? '/pages/mys/my_tixian/my_tixian' : pageFen">
									<image :src="imgUrl + '/dzx_img112.png'"></image>
									<text>{{ words.withdraw_apply.title.value }}</text>
								</view>
							</view>
						</view>
						<!-- 仓管管理 -->
						<view v-if="jmsetting.is_open == 1 && islogin && yonghujuese.role_type != 20" class="my_bottom_item1">
							<view class="my_bottom_item1_title">
								<view class="my_bottom_item1_t1">{{ workers.index.title.value }}</view>
							</view>
							<view class="my_bottom_item1_list" style="padding: 0">
								<view
									v-if="yonghujuese.role_type > 0"
									class="my_bottom_item1_cont"
									@tap="goyemian"
									:data-url="yonghujuese.role_type > 0 ? '/pages/cangkuyuan/cangkuyuan' : pageWorker"
								>
									<image class="jiameng" :src="imgUrl + '/jiameng_01.png'"></image>
									<text>{{ workers.index.title.value }}</text>
								</view>
								<view
									v-if="yonghujuese.role_type == 0"
									class="my_bottom_item1_cont"
									@tap="goyemian"
									:data-url="yonghujuese.role_type > 0 ? '/pages/mys/my_worker/worker_index/worker_index' : pageWorker"
								>
									<image class="jiameng" :src="imgUrl + '/jiameng_01.png'"></image>
									<text>{{ $t('page_my.application_to_join') }}</text>
								</view>
								<view class="my_bottom_item1_cont" @tap="goyemian" :data-url="yonghujuese.role_type > 0 ? '/pages/shopadmin/my_order/my_order' : pageWorker">
									<image class="jiameng" :src="imgUrl + '/jiameng_02.png'"></image>
									<text>{{ workers.order.title.value }}</text>
								</view>
								<view
									class="my_bottom_item1_cont"
									@tap="goyemian"
									:data-url="yonghujuese.role_type > 0 ? '/pages/shopadmin/my_balancedetail/my_balancedetail' : pageWorker"
								>
									<image class="jiameng" :src="imgUrl + '/jiameng_03.png'"></image>
									<text>{{ workers.withdraw_list.title.value }}</text>
								</view>
								<view class="my_bottom_item1_cont" @tap="goyemian" :data-url="yonghujuese.role_type > 0 ? '/pages/shopadmin/my_worker/my_worker' : pageWorker">
									<image class="jiameng" :src="imgUrl + '/jiameng_04.png'"></image>
									<text>{{ workers.team.title.value }}</text>
								</view>
								<view class="my_bottom_item1_cont" @tap="goyemian" :data-url="yonghujuese.role_type > 0 ? '/pages/shopadmin/my_tixian/my_tixian' : pageWorker">
									<image class="jiameng" :src="imgUrl + '/jiameng_05.png'"></image>
									<text>{{ workers.withdraw_apply.title.value }}</text>
								</view>
							</view>
						</view>
						<view class="my_bottom_item1 qita">
							<view class="my_bottom_item1_title">
								<view class="my_bottom_item1_t1">{{ $t('page_my.other_service') }}</view>
							</view>
							<view class="my_bottom_item2_list">
								<view v-if="is_sharp == 1 && switchFunlist.is_tuanzhang == 1" class="my_bottom_item2_cont text-center" @tap="goyemian" data-url="/pages/mys/my_sharp/my_sharp">
									<image :src="imgUrl + '/dzx_img118.png'"></image>
									<text>{{ $t('page_my.group_center') }}</text>
								</view>
								<view v-if="!is_sharp && switchFunlist.is_tuanzhang == 1" class="my_bottom_item2_cont text-center" @tap="goyemian" data-url="/pages/sharing/user">
									<image :src="imgUrl + '/dzx_img118.png'"></image>
									<text>{{ $t('page_my.apply_for_team_leader') }}</text>
								</view>
								<view v-if="is_sharp == 4 && switchFunlist.is_tuanzhang == 1" class="my_bottom_item2_cont text-center" @tap="goyemian" data-url="/pages/sharing/user_modify">
									<image :src="imgUrl + '/dzx_img118.png'"></image>
									<text>{{ $t('page_my.audit_failure') }}</text>
								</view>
								<view v-if="is_sharp == 3 && switchFunlist.is_tuanzhang == 1" class="my_bottom_item2_cont text-center">
									<image :src="imgUrl + '/dzx_img118.png'"></image>
									<text>{{ $t('page_my.moderated') }}</text>
								</view>
								<view v-if="switchFunlist.is_email == 1" class="my_bottom_item2_cont text-center text-center" @tap="goyemian" data-url="/pages/mys/my_bangdingemil/my_bangdingemil">
									<image :src="imgUrl + '/dzx_img113.png'"></image>
									<text>{{ $t('page_my.bind_mailbox') }}</text>
								</view>
								<view
									v-if="switchFunlist.is_renling == 1"
									class="my_bottom_item2_cont text-center"
									@tap="goyemian"
									data-url="/pages/indexs/shenqingdb_renling/shenqingdb_renling"
								>
									<image :src="imgUrl + '/dzx_img114.png'"></image>
									<text>{{ $t('page_my.package_claim') }}</text>
								</view>
								<view v-if="switchFunlist.is_address == 1" class="my_bottom_item2_cont text-center" @tap="goyemian" data-url="/pages/pintuans/dizhi/dizhi">
									<image :src="imgUrl + '/dzx_img115.png'"></image>
									<text>{{ $t('page_my.shipping_address') }}</text>
								</view>
								<view
									v-if="switchFunlist.is_warehouse == 1"
									class="my_bottom_item2_cont text-center"
									@tap="goyemian"
									data-url="/pages/indexs/cangkudizhi_list/cangkudizhi_list"
								>
									<image :src="imgUrl + '/dzx_img116.png'"></image>
									<text>{{ $t('page_my.warehouse_address') }}</text>
								</view>
								<view v-if="switchFunlist.is_chayan == 1" class="my_bottom_item2_cont text-center" @tap="goyemian" data-url="/pages/mys/my_shenqingcy/my_shenqingcy">
									<image :src="imgUrl + '/dzx_img117.png'"></image>
									<text>{{ $t('page_my.apply_for_inspection') }}</text>
								</view>
								<view v-if="switchFunlist.is_daifu == 1" class="my_bottom_item2_cont text-center" @tap="goyemian" data-url="/pages/mys/my_cupponcenter/my_cupponcenter">
									<image :src="imgUrl + '/dzx_img118.png'"></image>
									<text>{{ $t('page_my.coupon_center') }}</text>
								</view>
								<view v-if="switchFunlist.is_problem == 1" class="my_bottom_item2_cont text-center" @tap="goyemian" data-url="/pages/mys/my_jinyun/my_jinyun?type=0">
									<image :src="imgUrl + '/dzx_img119.png'"></image>
									<text>{{ $t('page_my.newbie_question') }}</text>
								</view>
								<view v-if="switchFunlist.is_about == 1" class="my_bottom_item2_cont text-center" @tap="goyemian" data-url="/pages/mys/my_gywm/my_gywm">
									<image :src="imgUrl + '/dzx_img120.png'"></image>
									<text>{{ $t('page_my.about_us') }}</text>
								</view>
					<!-- 			<view
									class="my_bottom_item2_cont"
									v-if="yonghujuese.role_type != 0 && yonghujuese.role_type"
									@tap="goyemian"
									:data-url="'/pages/cangkuyuan/cangkuyuan?juese=' + yonghujuese.role_type"
								>
									<image :src="imgUrl + '/dzx_img195.png'"></image>
									<text>{{ yonghujuese.role_name }}</text>
								</view> -->
								<view class="my_bottom_item2_cont text-center" v-if="islogin" @tap="exitapp">
									<image :src="imgUrl + '/exit.png'"></image>
									<text>{{ $t('page_my.exitapp') }}</text>
								</view>
							</view>
						</view>
						<view class="copyright">
							<text>{{ $t('page_my.version_number') }}：{{ copyright.version }}</text>
						</view>
					</view>
				</view>
			</view>
		</view>
		<tabbar :showmenu="menu_type" current="4"></tabbar>
		<view class="mobile_bind_layer" v-if="switchFunlist.is_getphone == 1 && bindMobileDialg && switchFunlist.is_external == 0">
			<view class="mobile_bind">
				<view class="mobile_tips">{{ $t('page_my.bingPhoneNumHinttext') }}</view>
				<button type="primary" open-type="getPhoneNumber" @getphonenumber="getphonenumber">{{ $t('page_my.binding_mobile_phone_number') }}</button>
			</view>
		</view>
		<!-- 强制授权昵称 -->
		<view class="mobile_bind_layer" v-if="zhishi && switchFunlist.is_setnickname == 1">
			<view class="nickname_bind">
				<view class="mobile_tips">{{ $t('page_my.wechat_name_authorized') }}</view>
				<view class="avatarUrlsf">
					<view class="cangkuyuan_saomaruku_item1_cont_l">
						<text>{{ $t('page_userinfo.avatarUrl') }}</text>
					</view>
					<view class="cangkuyuan_saomaruku_item2_r3">
						<button class="chooseAvatar" open-type="chooseAvatar" @chooseavatar="onChooseAvatar"></button>
						<image  class="avatarUrl" :src="userarr.avatarUrl ? userarr.avatarUrl : imgUrl + '/dzx_img94.png'" mode="aspectFill"></image>
					</view>
				</view>
				
				<view class="nickname_tips">
					<input type="nickname" @input="inputnickname" @change="inputnickname"  value="" :placeholder="$t('page_my.wechat_name')" />
				</view>
				
				<view class="nickname_tips">
					<input type="text"   v-model="user_code" :placeholder="$t('page_my.请输入用户编号')" />					
				</view>
				<view class="code_tips"><text>{{ $t('page_my.请输入用户编号提示') }}</text></view>
				<button type="primary" @tap="changenick()">{{ $t('page_my.bind_name') }}</button>
			</view>
		</view>
		<!-- 唛头列表 -->
		<view class="mobile_bind_layer" v-if="markshow">
			<view class="usermark_bind">
				<view class="mobile_tips">{{ $t('page_my.usermark') }}</view>
				<view class="nickname_tips">
					<picker mode="selector" @change="bindusermarkChange" :value="markindex" :range="usermarkList" range-key="mark">
						<view class="baoguo_item2_cont_r">
							<text>{{ usermarkList[markindex].mark }}</text>
							<image :src="imgUrl + '/dzx_img25.png'"></image>
						</view>
					</picker>
				</view>
				<view class="usermark">
					<button type="warn" @tap="addmarkshows()">{{ $t('page_my.add_usermark') }}</button>
					<button type="primary" @tap="changeusermark()">{{ $t('page_my.bind_usermark') }}</button>
				</view>
			</view>
		</view>
		<!-- 唛头添加 -->
		<view class="mobile_bind_layer" v-if="addmarkshow">
			<view class="usermark_bind">
				<view class="mobile_tips">{{ $t('page_my.please_enter_usermark') }}</view>
				<view class="nickname_tips">
					<input type="text" v-model="newusermark" :placeholder="$t('page_my.please_enter_usermark')" />
				</view>
				<view class="usermark">
					<button type="warn" @tap="closeusermark()">关闭</button>
					<button type="primary" @tap="addusermarkP()">{{ $t('page_my.add_usermark') }}</button>
				</view>
			</view>
		</view>
		<!-- 强制授权手机号 -->
		<view class="mobile_bind_layer" v-if="phonezhishi && switchFunlist.is_getphone == 1 && switchFunlist.is_external == 1">
			<view class="nickname_bind">
				<view class="mobile_tips">{{ $t('page_my.binding_mobile_phone_number_hint_text') }}</view>
				<view class="nickname_tips">
					<input @input="inputphone" @change="inputphone" type="text" value="" :placeholder="$t('page_my.please_enter_phone_number')" />
				</view>
				<button type="primary" @tap="changephone()">{{ $t('page_my.save_phone_number') }}</button>
			</view>
		</view>
	</view>
</template>

<script>
import tabbar from '@/components/tabbar/tabbar.vue';
const app = getApp();
let request = require('../../utils/require');
let platfrom = require('../../core/platform.js')
export default {
	components: {
		tabbar
	},
	data() {
		return {
			navH: app.globalData.navHeight,
			gaodu: app.globalData.height,
			gaodutops: app.globalData.top,
			imgUrl: app.globalData.imgUrl,
			indexId: 4,
			platfrom:platfrom.default,
			menu_type: uni.getStorageSync('menu_type'),
			userclient:uni.getStorageSync('userclient'),
			is_dealer: false,
			switch: [],
			words: '',
			jmsetting: '',
			zhishi: false,
			phonezhishi: false,
			item: {
				indexId: 4,
				colors: '#fff;',
				isfujin: '',
				isshop: ''
			},
			banertrue: false,
			tankuangisshows: false,
			bindMobileDialg: false,
			bindNickNameDialg: true,
			token: '',
			islogin: false,
			is_sharp: false,
			userarr: {
				avatarUrl: '',
				nickName: '',
				user_id: '',
				balance: '',
				points: false
			},
			//用户信息
			yonghujuese: {
				role_name: '',
				role_type: 0
			},
			nickname: '',
			userphone: '',
			workers: '',
			//用户角色
			tongjishu: {
				verify: 0,
				no_pay: 0,
				no_send: 0,
				send: 0,
				complete: 0
			}, //订单统计数
			lang: 'zh-CN',
			switchFunlist: '',
			pageFen: '/pages/mys/my_dealer/dealer_index/dealer_index',
			pageWorker: '/pages/mys/my_worker/worker_index/worker_index',
			copyright: uni.getStorageSync('copyright'),
			code: '',
			officialaccount:'',
			is_passwordlogin: 0,
			usermarkList:[],
			markindex:0,
			markshow:false,
			usermark:"",
			addmarkshow:false,
			newusermark:"",
			pointsetting:"",
			user_code:""
		};
	}, //滑动显示顶部
	onPageScroll: function(e) {
		if (e.scrollTop > this.navH + 50) {
			this.banertrue = true
		} else {
			this.banertrue = false
		}
	},
	/**
	 * 生命周期函数--监听页面加载
	 */
	onLoad(options) {
		var that = this;
		if (uni.getStorageSync('token')) {
			that.token = uni.getStorageSync('token');
			that.checkAuthMobile(uni.getStorageSync('token'));
		}
		if(options.islogin==true){
			this.islogin = true;
		}
		var scene = decodeURIComponent(options.scene);
		that.switchFun();
		if ((scene != '') & (scene != null) & (scene != 'undefined')) {
			var sceneArr = this.parseUrlStr(scene);
			this.codes = sceneArr.code;
			uni.setStorageSync('referee_id', sceneArr.user);
		}
		this.getLangPackage();
		
	},
	onShow() {
		var that = this;
		that.islogin = true;
		that.switchFun();
		console.log(uni.getStorageSync("usermark"),87654);
		if (uni.getStorageSync('token')) {
			that.islogin= true
			that.gerenxinxi();
			that.getDealerCenter();
			that.getWorkerCenter();
		} else {
			that.islogin= false
			that.platfrom= platfrom.default		
			if(platfrom.default == 'H5'){
				console.log(platfrom,8765);
			}else if(platfrom.default == 'H5-WEIXIN'){
				this.getUrlCode();
			}
		}
		that.shujutongji();
		
		uni.setNavigationBarTitle({
		      title: uni.getStorageSync("setting").name
		});
	},
	/**
	 * 生命周期函数--监听页面初次渲染完成
	 */
	onReady: function() {},
	/**
	 * 生命周期函数--监听页面隐藏
	 */
	onHide: function() {},
	/**
	 * 生命周期函数--监听页面卸载
	 */
	onUnload: function() {},
	/**
	 * 页面相关事件处理函数--监听用户下拉动作
	 */
	onPullDownRefresh: function() {},
	/**
	 * 页面上拉触底事件的处理函数
	 */
	onReachBottom: function() {},
	/**
	 * 用户点击右上角分享
	 */
	onShareAppMessage: function() {
		var thisUserInfo = uni.getStorageSync('userInfo');
		var sett =  uni.getStorageSync('setting');
		var shareObj = {
			title: sett.name,
			desc: sett.desc,
			// 默认是小程序的名称(可以写SOGO express集运等)
			path: '/pages/my/my?scene=uid%3A' + thisUserInfo.user_id,
			// 默认是当前页面，必须是以‘/’开头的完整路径
			imageUrl: '',
			//自定义图片路径，可以是本地文件路径、代码包文件路径或者网络图片路径，支持PNG及JPG，不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
			success: function(res) {
				// 转发成功之后的回调
				if (res.errMsg == 'shareAppMessage:ok') {
				}
			},
			fail: function() {
				// 转发失败之后的回调
				if (res.errMsg == 'shareAppMessage:fail cancel') {
					// 用户取消转发
				} else {
					if (res.errMsg == 'shareAppMessage:fail') {
					}
				}
			}
		};
		return shareObj;
	},
	methods: {
		changelang(){
			
			// this.globalData.checkLocalLanguage();
			// const appLanguage = uni.getSystemInfoSync().appLanguage;
			// 系统默认 zh-Hans（中文）
			// if (appLanguage === 'zh-Hans') {
				uni.showModal({
					content: '点击切换语言 \n go to the switch language',
					// confirmText:this.$t('components_mx_datepicker.sure'),
					confirmColor:'#27cc9d',
					success(res) {
						if (res.confirm) {
							uni.navigateTo({
								url: '/pages/switchLanguage/index'
							});
						}
					}
				});
			// }
		},
		closeusermark(){
			var that = this;
			that.markshow = false;
			that.addmarkshow = false;
		},
		addusermarkP(){
			var that = this;
			if (that.newusermark == '') {
				uni.showToast({
					icon: 'none',
					title: this.$t('page_other.唛头不能为空')
				});
				return;
			}
			var data = {
				token: uni.getStorageSync('token'),
				mark: that.newusermark
			};
			request.get(`index.php?s=/api/user/newAddUserMark&wxapp_id=` + uni.getStorageSync('web_id'), data).then(res => {
				if (res.data.code == 1) {
					that.gerenxinxi();
					that.addmarkshow = false;
				}
			});
		},
		//选择唛头
		bindusermarkChange: function(e) {
			this.markindex = e.detail.value
		},
		changeusermark(){
			var that = this;
			uni.setStorageSync("usermark",this.usermarkList[this.markindex]);
			that.usermark = this.usermarkList[this.markindex];
			that.markshow = false;
		},
		changemarkshow(){
			var that = this;
			console.log(34567)
			that.markshow = true;
		},
		addmarkshows(){
			var that = this;
			that.addmarkshow = true;
		},
		handleAgreePrivacyAuthorization(){
			console.log(34567)
		},
		//获取默认语言
		getLangPackage() {
			let that = this
			request.get(`index.php?s=/api/page/getLangSetting&wxapp_id=` + uni.getStorageSync('web_id')).then(res => {
				if (res.data.code == 1) {
						const that = this;
						console.log(res.data.data.default,789)
						request
							.post(`index.php?s=/api/page/getLangPackage&wxapp_id=` + uni.getStorageSync('web_id'), {
								type: res.data.data.default
							})
							.then(resE => {
								if (resE.data.code == 1) {
									console.log(resE.data.data,23)
									//动态插入内容到i18n
									that.$i18n.setLocaleMessage(res.data.data.default, resE.data.data);
									//本地语言开关切换
									if(uni.getStorageSync("lang")==''){
										that.$i18n.locale = res.data.data.default;
									}
									
								}
								uni.hideLoading();
							});
					
				}
			}); 
		},
		exitapp(){
			uni.showToast({
				title:"退出成功"
			})
			uni.setStorageSync("token",'');
			// #ifdef APP-PLUS
				uni.navigateTo({
					url:"/pages/mys/login/login"
				})
				return;
			// #endif
			 // #ifdef H5
				location.reload()
				return;
			// #endif
			// #ifndef H5
				this.userarr = [];
				this.yonghujuese= [];
				this.reload();
			// #endif
			
		},
		reload() {
		        // 页面重载
		        const pages = getCurrentPages()
		        // 声明一个pages使用getCurrentPages方法
		        const curPage = pages[pages.length - 1]
		        // 声明一个当前页面
		        curPage.onLoad(curPage.options) // 传入参数
		        curPage.onShow()
		        curPage.onReady()
		        // 执行刷新
		},
		getUrlCode() {
			var that = this;
			var code = this.getUrlParam('code'); // 截取路径中的code，如果没有就去微信授权，如果已经获取到了就直接传code给后台获取openId
			var local = window.location.href;
			console.log(code, 8676);
			var redirect_url = encodeURIComponent(local); //回调的地址要编码
			if (code == null || code === '') {
				this.getUserProfile();
			} else {
				var data = {
					code: code
				};
				request.post(`index.php?s=/api/user/loginwx&wxapp_id=` + uni.getStorageSync('web_id'), data).then(result => {
					console.log(result, 678);
					that.token = result.data.data.token;
					uni.setStorageSync('token', that.token);
					that.gerenxinxi();
					that.shujutongji();
					that.getWorkerCenter();
					that.getDealerCenter();
				});
			}
		},
		getUrlParam(code) {
			var reg = new RegExp('(^|&)' + code + '=([^&]*)(&|$)');
			var r = window.location.search.substr(1).match(reg);
			if (r != null) return unescape(r[2]);
			return null;
		},
		getUserProfile() {
			if (!this.islogin) {
				if(platfrom.default=='H5-WEIXIN'){
					if(this.is_passwordlogin==1){
						uni.navigateTo({
							url:"/pages/mys/login/login"
						})
						return;
					}else{
						request.post(`index.php?s=/api/page/getCode&wxapp_id=` + uni.getStorageSync('web_id')).then(result => {
							console.log(result, 78);
							if (result.data.code == 1) {
								window.location = result.data.data;
							}
						});
					}
				}else{
					uni.navigateTo({
						url:"/pages/mys/login/login"
					})
				}
			}
		},
		onChooseAvatar(e) {
			var that = this;
			const { avatarUrl } = e.detail;
			wx.uploadFile({
				filePath: avatarUrl,
				name: 'iFile',
				url: app.globalData['url'] + `index.php?s=/api/upload/avatarUrlimage&wxapp_id=` + uni.getStorageSync('web_id') + '&token=' + uni.getStorageSync('token'), //服务器端接收图片的路径
				success: function(res) {
					console.log(res, 7777); //发送成功回调
					let uploadFileResJson = JSON.parse(res.data.replace('\uFEFF', ''));
					that.userarr.avatarUrl = uploadFileResJson.data.file_path;
				},
				fail: function(res) {
					console.log(res); //发送失败回调，可以在这里了解失败原因
				}
			});
		},
		changephone() {
			var that = this;
			if (that.userphone == '') {
				uni.showToast({
					icon: 'none',
					title:this.$t('page_my.please_enter_phone_number')
				});
				return;
			}
			var data = {
				token: uni.getStorageSync('token'),
				userphone: that.userphone
			};
			request.get(`index.php?s=/api/user/changePhone&wxapp_id=` + uni.getStorageSync('web_id'), data).then(res => {
				if (res.data.code == 1) {
					that.phonezhishi = false
					uni.showToast({
						title: res.data.data
					});
					setTimeout(() => {
						that.gerenxinxi();
					}, 1000);
				}
			});
		},
		changenick() {
			var that = this;
			console.log(that.nickname,888);
			if (that.userarr.avatarUrl == '') {
				uni.showToast({
					icon: 'none',
					title:that.$t('page_other.请上传头像')
				});
				return;
			}
			if (that.nickname == '') {
				uni.showToast({
					icon: 'none',
					title:that.$t('page_other.昵称不能为空')
				});
				return;
			}
			var data = {
				token: uni.getStorageSync('token'),
				nickname: that.nickname,
				user_code:that.user_code
			};
			request.get(`index.php?s=/api/user/changeName&wxapp_id=` + uni.getStorageSync('web_id'), data).then(res => {
				if (res.data.code == 1) {
					that.zhishi = false
					that.gerenxinxi();
				}else{
					uni.showToast({
						icon: 'none',
						title: res.data.msg
					});
					return;
				}
			});
		},
		changenickname(e) {
			var that = this;
			console.log(e, 7786754);
			if (e.detail.value == '') {
				uni.showToast({
					icon: 'none',
					title: that.$t('page_other.昵称不能为空')
				});
				return;
			}
			var data = {
				token: uni.getStorageSync('token'),
				nickname: e.detail.value
			};
			request.get(`index.php?s=/api/user/changeName&wxapp_id=` + uni.getStorageSync('web_id'), data).then(res => {
				if (res.data.code == 1) {
					that.zhishi = false
					console.log(res, 're???');
				}
			});
			console.log(e, 7786754);
		},
		getphonenumber(e) {
			var that = this;
			console.log(e,9999);
			if (e.detail.errMsg == 'getPhoneNumber:ok') {
				console.log('用户点击了接受');
				var param = {
					encryptedData: encodeURIComponent(e.detail.encryptedData),
					iv: encodeURIComponent(e.detail.iv)
				};

				uni.login({
					success(res) {
						param['code'] = res.code;
						// 提交后端进行解密获取手机号
						console.log(uni.getStorageSync('token'), 888888);
						param['token'] = that.token;

						console.log(param, 22222);
						request.post(`index.php?s=/api/user/wechatMobile&wxapp_id=` + uni.getStorageSync('web_id'), param).then(res => {
							uni.hideLoading();
							console.log(res);
							if (res.data.code == 1) {
								that.bindMobileDialg = false;
								uni.showToast({
									title: that.$t('page_other.手机绑定成功')
								});

								uni.setStorageSync('token', that.token);
								// that.gerenxinxi();
								// that.shujutongji();
							} else {
								uni.showToast({
									icon: 'none',
									title: res.Data
								});
							}
						});
					}
				});
			} else {
				console.log('用户点击了拒绝');
			}
		},
		qiehuanyuyan() {
			console.log(this.$i18n, 'this.$i18n.locale');
			if (this.lang === 'zh-CN') {
				this.lang = 'en-US';
				this.$i18n.locale = this.lang; //关键语句
			} else {
				this.lang = 'zh-CN';
				this.$i18n.locale = this.lang; //关键语句
			}
			localStorage.setItem('locale', this.lang);
		},
		/**
		 * 跳转到售后列表
		 */
		onTargetRefund() {
			uni.navigateTo({
				url: '/pages/sharing/order/refund/index'
			});
		},
		onRedirect() {
			uni.navigateTo({
				url: '/pages/mys/my_fenxiaoewm'
			});
		},
		//数据统计
		shujutongji() {
			var that = this;
			var data = {
				token: uni.getStorageSync('token')
			};
			if(uni.getStorageSync("usermark")){
				data['usermark'] = uni.getStorageSync("usermark").mark;
			}
			request.get(`index.php?s=/api/package/packTotal&wxapp_id=` + uni.getStorageSync('web_id'), data).then(res => {
				if (res.data.code == 1) {
					that.tongjishu = res.data.data
					console.log(res, 're???');
				}
			});
		},

		inputnickname(e) {
			var that = this;
			console.log(e,435)
			that.nickname = e.detail.value
		},
		inputphone(e) {
			var that = this;
			console.log(e,435)
			that.userphone = e.detail.value
		},
		
		//登录/注册
		loginChange: function(e) {
			let that = this;
			if(that.is_passwordlogin==1){
				uni.navigateTo({
					url:"/pages/mys/login/login"
				})
				return;
			}
					uni.login({
						success: res => {
							console.log(res,7865)
							// 发送 res.code 到后台换取 openId, sessionKey, unionId
							if (res.code) {
								//发起网络请求
								let code = res.code; // console.log(code)
								// uni.setStorageSync('userInfo', result.userInfo);
								let userInfo = uni.getStorageSync('userInfo');
								let data = {
									code: code,
									referee_id: uni.getStorageSync('referee_id') // invited_id:wx.getStorageSync('sceneArr').user_id,
								};
								request.post(`index.php?s=/api/user/login&wxapp_id=` + uni.getStorageSync('web_id'), data).then(res => {
									console.log(res, '22222');
									if (res.data.code == 1) {
										that.token = res.data.data.token;
										uni.setStorageSync('token', that.token);
										// that.checkAuthMobile(res.data.data.token);
										that.gerenxinxi();
										that.shujutongji();
										that.getWorkerCenter();
										that.getDealerCenter();
									}
								});
							} else {
								uni.showToast({
									title: that.$t('page_other.网络似乎开小差了！'),
									icon: 'none',
									duration: 2000
								});
							}
						}
					}); 
		},
		checkAuthMobile() {
			var that = this;
			var param = {
				token: that.token
			};
			request.post(`index.php?s=/api/user/detail&wxapp_id=` + uni.getStorageSync('web_id', param), param).then(result => {
				if (result.data.code == 1) {
					var data = result.data.data.userInfo;
					uni.setStorageSync('userInfo', data);
					if ((data.nickName == that.$t('page_other.微信用户') || data.nickName == ' ') && uni.getStorageSync('setting')['is_setnickname'] == 1) {
						that.zhishi = true
					}

					if ((data.mobile == '' || data.mobile == ' ') && uni.getStorageSync('setting')['is_getphone'] == 1 && uni.getStorageSync('setting')['is_external'] == 1) {
						that.phonezhishi = true
					}

					if ((!data.mobile || data.mobile == 0) && uni.getStorageSync('setting')['is_external'] == 0) {
						this.bindMobileDialg = true;
					} else {
						uni.setStorageSync('token', that.token);
						this.gerenxinxi();
						this.shujutongji();
					}
				}
			});
			console.log(param, '2222');
		},
		gerenxinxi() {
			var that = this;
			var data = {
				token: uni.getStorageSync('token')
			};
			request.get(`index.php?s=/api/user/detail&wxapp_id=` + uni.getStorageSync('web_id'), data).then(res => {
				if (res.data.code == 1) {
					if ((res.data.data.userInfo.nickName == that.$t('page_other.微信用户') || res.data.data.userInfo.nickName == '') && uni.getStorageSync('setting')['is_setnickname'] == 1) {
						that.zhishi = true
					}

					if (res.data.data.userInfo.mobile == '' && uni.getStorageSync('setting')['is_getphone'] == 1) {
						that.phonezhishi= true
					}
					
					if(this.userclient.loginsetting.is_addressforce==1 && res.data.data.userInfo.address.length ==0){
						uni.showToast({
							title: that.$t('page_other.地址必须填写'),
							icon: 'none',
						});
						setTimeout(function(){
							uni.navigateTo({
								url:"/pages/pintuans/dizhi/dizhi"
							})
						},2000)	
					}
					console.log(res, 're????');
						that.is_sharp = res.data.data.userInfo.is_sharp,
						that.userarr = res.data.data.userInfo,
						that.islogin = true
				}
			});
			request.get(`index.php?s=/api/Useropration/role&wxapp_id=` + uni.getStorageSync('web_id'), data).then(res => {
				if (res.data.code == 1) {
					that.yonghujuese = res.data.data.userRole
					console.log(res, 'xinxi');
				}
			});
			
		},

		jiyundingdan(e) {
			if (uni.getStorageSync('token')) {
				uni.navigateTo({
					url: e.currentTarget.dataset.url
				});
			} else {
				uni.showToast({
					title:  this.$t('page_my.please_log_in_first')
				});
			}
		},

		pintuandingdan(e) {
			if (e.currentTarget.dataset.item == 1) {
				uni.navigateTo({
					url: e.currentTarget.dataset.url
				});
			}
		},

		tankuangguanbi() {
			this.tankuangisshows = false
		},

		tankuang() {
			this.tankuangisshows = true
		},

		jump_indexs(e) {
			console.log('sssssss');
			uni.reLaunch({
				url: '../index/index'
			});
		},
		//拨打电话
		freeTell: function(e) {
			uni.makePhoneCall({
				phoneNumber: e.currentTarget.dataset.phone
			});
		},
		jump_chaxun(e) {
			uni.reLaunch({
				url: '/pages/chaxun/chaxun'
			});
		},

		jump_pintuan(e) {
			uni.navigateTo({
				url: '/pages/indexs/yunfeigusuan/yunfeigusuan'
			});
		},

		jump_personal(e) {
			uni.reLaunch({
				url: '/pages/my/my'
			});
		},

		goyemian(e) {
			if (uni.getStorageSync('token')) {
				uni.navigateTo({
					url: e.currentTarget.dataset.url,
					fail: res => {
						console.log(res, 'err');
					}
				});
			} else {
				uni.showToast({
					title: this.$t('page_my.please_log_in_first')
				});
			}
		},
		tiaozhuanofficialaccount(e) {
			console.log(e, 8888999);
			var type = e.currentTarget.dataset.type;
			var urlweb = e.currentTarget.dataset.url;
			var image = this.officialaccount.official_pic;
			if (type == 20) {
				uni.navigateTo({
					url: '/pages/webview/webview?' + 'url=' + urlweb
				});
			}
			if (type == 10) {
				uni.previewImage({
					urls:[image]
				})
				return;
			}
			uni.navigateTo({
				url: e.currentTarget.dataset.url
			});
		},
		tiaozhuan(e) {
			uni.navigateTo({
				url: e.currentTarget.dataset.url
			});
		},

		tiaozhuanus(e) {
			console.log(e, 'e?');
			uni.navigateTo({
				url: e.currentTarget.dataset.url
			});
		},

		parseUrlStr(e) {
			var s = e.split('&');
			var t = {};
			var m = s[0].split('=');
			var n = s[1].split('=');
			t['user'] = n[1];
			t['code'] = m[1];
			return t; // for(var i;i<s.length;i++){
			//   var m=s[i].split('=')
			//   t['user']= m[1];
			//   t[]
			// }
		},

		jumpzuo() {
			uni.navigateBack();
		},
		/**
		 * 获取分销商中心数据`index.php?s=/api/user.dealer/center&wxapp_id=` + uni.getStorageSync('web_id')
		 */
		getDealerCenter() {
			var that = this;
			var data = {
				token: uni.getStorageSync('token')
			};
			request.get(`index.php?s=/api/user.dealer/center&wxapp_id=` + uni.getStorageSync('web_id'), data).then(res => {
				if (res.data.code == 1) {
					// 设置当前页面标题
					uni.setNavigationBarTitle({
						words: res.data.data.words.index.title.value
					});
					if (res.data.data.is_dealer) {
						uni.navigateTo({
							url: '../../my_fenxiao/my_fenxiao'
						});
					}
					that.words = res.data.data.words
					that.is_dealer = res.data.data.is_dealer
				}
			});
		},
		getWorkerCenter() {
			var that = this;
			var data = {
				token: uni.getStorageSync('token')
			};
			request.get(`index.php?s=/api/shop.worker/center&wxapp_id=` + uni.getStorageSync('web_id'), data).then(res => {
				if (res.data.code == 1) {
					// 设置当前页面标题
					// uni.setNavigationBarTitle({
					//   workers: res.data.data.words.index.title.value
					// });
					if (res.data.data.is_dealer) {
						uni.navigateTo({
							url: '../../my_fenxiao/my_fenxiao'
						});
					}
					that.workers = res.data.data.words
					that.is_worker =  res.data.data.is_worker
					that.jmsetting =  res.data.data.jmsetting
				}
			});
		},
		getUsermarkList(){
			var that = this;
			var data = {
				token: uni.getStorageSync('token')
			};
			if(that.switchFunlist.usercode_mode.is_show==2){
				request.get(`index.php?s=/api/user/getusermark&wxapp_id=` + uni.getStorageSync('web_id'), data).then(res => {
					if (res.data.code == 1) {
						that.usermarkList = res.data.data
						if(!uni.getStorageSync("usermark")){
							that.usermark = that.usermarkList[0]
							uni.setStorageSync("usermark",this.usermarkList[this.markindex]);
						}else{
							that.usermark = uni.getStorageSync("usermark");
						}
					}
				});
			}else{
				uni.setStorageSync("usermark","");
			}
		},
		//功能开关
		switchFun() {
			var that = this;
			var data = {
				token: uni.getStorageSync('token')
			};
			request.post(`index.php?s=/api/page/service&wxapp_id=` + uni.getStorageSync('web_id'), data).then(res => {
				if (res.data.code == 1) {
					that.switchFunlist = res.data.data.values
					that.menu_type = res.data.data.values.menu_type
					that.pointsetting = res.data.data.points
					that.officialaccount = res.data.data.userclient==null?res.data.data.userclient:res.data.data.userclient.officialaccount
					that.copyright = res.data.data.copyright
					that.is_passwordlogin = res.data.data.userclient.loginsetting.is_passwordlogin
					uni.setStorageSync('service_phone', res.data.data.values.service_phone);
					uni.setStorageSync('menu_type', res.data.data.values.menu_type);
					uni.setStorageSync('userclient', res.data.data.userclient);
					
					//获取唛头列表
					that.getUsermarkList();
					
				} else {
					uni.showToast({
						title: res.data.msg,
						icon: 'none'
					});
				}
				console.log(that.switchFunlist, 777);
			});
		}
	}
};
</script>
<style>
@import './my.css';
</style>
<style lang="scss" scoped>
.container {
	padding: 0 60rpx;
	font-size: 32rpx;
	background: #fff;
	min-height: 100vh;
}
.text-center{text-align: center;}
.wechatapp {
	padding: 80rpx 0 48rpx;
	border-bottom: 1rpx solid #e3e3e3;
	margin-bottom: 72rpx;
	text-align: center;

	.header {
		width: 190rpx;
		height: 190rpx;
		border: 4rpx solid #fff;
		margin: 0 auto 0;
		border-radius: 50%;
		overflow: hidden;
		box-shadow: 2rpx 0 10rpx rgba(50, 50, 50, 0.3);

		.image {
			display: block;
			width: 100%;
			height: 100%;
		}
	}
}

.auth-title {
	color: #585858;
	font-size: 34rpx;
	margin-bottom: 40rpx;
}

.auth-subtitle {
	color: #888;
	margin-bottom: 88rpx;
	font-size: 28rpx;
}

.login-btn {
	padding: 0 20rpx;

	.button {
		height: 88rpx;
		background: #04be01;
		color: #fff;
		font-size: 30rpx;
		border-radius: 999rpx;
		display: flex;
		justify-content: center;
		align-items: center;
	}
}

.no-login-btn {
	margin-top: 20rpx;
	padding: 0 20rpx;

	.button {
		height: 88rpx;
		background: #dfdfdf;
		color: #fff;
		font-size: 30rpx;
		border-radius: 999rpx;
		display: flex;
		justify-content: center;
		align-items: center;
	}
}
</style>
